<script lang="ts" setup>
import { getSvg } from "@/utils";
import ImgPicker from "@/components/ImgPicker/index.vue";
import useScan from "../hooks/useScan";
// function toggleTorch() {
//   torchActive.value = !torchActive.value;
// }
const { onDetect, torchActive, toggleTorch } = useScan();
</script>
<template>
  <div class="h-full flex flex-col justify-around items-center">
    <img
      @click="toggleTorch"
      class="rounded-50% w-60 h-60"
      :class="{
        'brightness-[1.5] drop-shadow-[0_0_8px_yellow]': torchActive
      }"
      :src="getSvg('flashlight')"
      alt=""
    />
    <ImgPicker @detect="onDetect" />
  </div>
</template>
